package yf.mall.controller.api;

import com.yf.annotation.IgnoreAuth;
import com.yf.response.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yf.mall.entity.SecCodeEntity;
import yf.mall.service.SecCodeService;

import javax.annotation.Resource;
import java.util.Map;

@RequestMapping("/api/sec")
@RestController
public class ApSecCodeController {

    @Resource
    private SecCodeService secCodeService;

    @GetMapping("/code/{code}")
    @IgnoreAuth
    public R code(@PathVariable String code){
       SecCodeEntity codeEntity = secCodeService.findByCode(code);
        return R.ok(codeEntity);
    }

    @GetMapping("/box/{code}")
    @IgnoreAuth
    public R box(@PathVariable String code){
        SecCodeEntity codeEntity = secCodeService.findByCode(code);
        return R.ok(codeEntity);
    }


}
